Skip to content

DO NOT MERGE: 0.10.7 deferred composition check - #1738

Closed
davidtai wants to merge 85 commits into
devfrom
ci/0.10.7-deferred-composition
Closed

davidtai wants to merge 85 commits into
devfrom
ci/0.10.7-deferred-composition

Conversation

@davidtai

@davidtai davidtai commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Composition check for the 0.10.7 deferred PRs. Do not merge; it is closed after the real PRs merge.

Branch: dev (bdcd04e) with these PRs merged in order: #1703, #1712, #1650, #1717, #1704, #1705, #1710, #1724, #1725, #1727. SDK pin libs/mlx-swift-lm = SDK main 2311af6e (SDK #383, #384, #375, #376 merged).

Conflicts resolved here (the same resolution goes onto the real branch at merge time):

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

jonathan308 and others added 30 commits October 27, 2026 23:24
The engine matched `stop` against every generated character, including the
private Harmony analysis. A sequence that appeared while gpt-oss reasoned
ended the request before any answer: finish_reason "stop", reasoning only,
empty content. On provider 0.10.4 with production gpt-oss-20b weights,
stop ["."] did this to 36/36 requests and ["\n\n"] to 14/36 (0/36 without a
stop); each cut reasoning is an exact prefix of its same-seed no-stop twin,
which went on to answer.

ModelEOSPolicy.stopStringScope gives GPT-OSS the Harmony final-channel scope
(<|channel|>final ... <|message|> up to <|end|>/<|return|>/<|call|>/<|start|>).
It travels with the EOS policy: EngineV2SlotFactory -> makeBridge ->
EngineV2Bridge -> CBv2Request.stopStringScope, and the matched-sequence
replay uses the same scope. Other models keep whole-output matching.

Bumps libs/mlx-swift-lm to 38b90ed1 (fix/harmony-final-stop-scope), which
adds the scope to StopHoldback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tool calls

With reasoning on, a client stop string matched the model's private
reasoning too, so one that appeared while the model reasoned (for example
"." or "\n\n") ended the request before any answer: finish_reason "stop",
reasoning only, empty content. GPT-OSS got an answer-channel scope in the
previous commit; Gemma 4 and <think> parsers need the opposite shape.

ReasoningStopScope picks the scope per request from its reasoning parser:
- gemma4: exclude <|channel>...<channel|> and <|tool_call>...<tool_call|>;
- qwen3/deepseek_r1: exclude <think>...</think> and <tool_call>...
  </tool_call>, starting inside when the prompt probe left a think block
  open (Qwen's "<think>\n" prefill);
- Harmony and no parser keep the model's scope.
submitTokenized(stopStringScope:) overrides the bridge's model scope, the
text, media and MiMo-media paths pass it (media now probes its prompt
before submit), and the reported stop_sequence replays the request's
scope. Pins mlx-swift-lm fix/reasoning-stop-scope-exclude (95e1d2b9).

Recorded on provider 0.10.4 with gemma-4-26b-qat-4bit, reasoning on, 36
prompts at temperature 0: stop ["."] and ["\n\n"] each gave 36/36 empty
answers, all proven cut inside the thought. With this change: 0/36 for
every stop set, no answer holds a stop, and each "."/"\n\n" answer equals
the full answer cut at its first stop with identical reasoning (36/36 each).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…matched

From the review pass:
- The native block engine (diffusion Gemma) builds its stop matcher
  without a scope, so it still matches the whole output. Its requests now
  carry no scope either, so the reported stop_sequence is the one that
  matched instead of nil.
- A scoped report could name a candidate that only starts where the
  matching one does: "\n" for "\nUser:" right after </think>, or a stop
  reaching into a span. It now names the first candidate that alone stops
  at the same place.
- Pins mlx-swift-lm b5d4c754 (simpler excluded-span release, identical
  behavior).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
libs/mlx-swift-lm moves to main 25bcd63f, the squash merge of
Layr-Labs/mlx-swift-lm#369 (the Harmony final-channel stop scope this PR
depends on). SDK main calls mlx-swift APIs newer than the pinned M5 hotfix
(MLXFast fencedInputs), so the stack moves with it to the revision SDK main
declares, as #1596 did: libs/mlx-swift c633d221 (nested mlx 72dffa2d,
mlx-c 2ac897e3) and libs/mlx 72dffa2d. All three are on their repos' main.
72dffa2d carries the NAX head-dim split attention JIT fix (mlx main
6bc9de5b), the same get_steel_attention_nax_kernel change as the 0.10.3
hotfix 31f550af.

Provider adaptations for the new SDK enum cases, behavior-preserving:
- MLXServerGenerationEvent.logprobs is token metadata, handled like .info by
  the GLM and JSON answer-format observers (the provider streams logprobs
  through its own channel and emits no such events today).
- MLXOpenAIServiceError.responseFormatCutOffByMaxTokens is the case the SDK
  split out of invalidResponseFormatOutput for a structured answer cut off
  by max_tokens; it keeps that case's 422 and retryable classification.

Verified on M5 Max: Gemma 4 26B QAT serves an 8,204-token prompt (the
0.10.2 crash path) with an 8,192-token prefix hit on repeat; gpt-oss-20b
stop ["."] still returns "The capital of Australia is Canberra".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The re-pinned mlx-swift-lm adds MLXServerGenerationEvent.logprobs. Seven
test helpers switch exhaustively over events; each treats it like its
existing non-content cases (.info / skipped). No assertion changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… into fix/gptoss-stop-in-reasoning

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Attempt 2 of run 40756992782 failed test_cli_result_write_failure_preserves_original_error_and_findings:
the test inherits the runner's GITHUB_RUN_ATTEMPT=2, so the budget runner reports
MANUAL_SCAN_RERUN_DISABLED. Attempt 1 on the same tree passed. No code change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1645 now pins mlx-swift-lm 25bcd63f (#369 merged on SDK main), mlx-swift
c633d221 and mlx 72dffa2d. The only conflict was the mlx-swift-lm pin.

The two engine commits of this PR (95e1d2b9, b5d4c754 on branch
fix/reasoning-stop-scope-exclude) are replayed onto 25bcd63f as 50ee329a and
25e65afc (branch fix/reasoning-stop-scope-exclude-on-25bcd63f), with an
identical diff, and the pin moves there.

Verified on the merged tree: SDK CBv2Sampling 55/55 (stop holdback 27/27);
provider swift-testing 469 tests in 68 suites, XCTest 37/38 with the one
failure only needing MIMO_PROMPT_ARTIFACT_DIRECTORY, which passes with the CI
fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1645 merged as squash e7f9818, so this branch's #1645 commits no
longer match master. The result is master plus only this PR's own
changes (the same +/- lines as 2841c6f..75abd7d outside libs/).

libs/mlx-swift-lm moves to 5ffbb801, the same two SDK commits replayed
on master's pin 2beb401f (branch
fix/reasoning-stop-scope-exclude-on-2beb401f; diff identical to
25bcd63f..25e65afc). libs/mlx-swift and libs/mlx stay at master's
c633d221 and 72dffa2d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refresh for 0.10.7. libs/mlx-swift-lm moves to 7f00abc4, the engine branch with SDK main 7933a0fa merged in. Conflicts: that gitlink; the bridge's logprobs channel, which master replaced with ordered events, so only this PR's stop scope stays; defaultMaxTokensContextLimit kept beside the scope; the sampling table in inference.md keeps master's min_p row.
swift-transformers' ByteFallbackDecoder releases <0xHH> tokens only when a
later token arrives, so a decode ending in them drops them and shows nothing
pending. Gemma 4 writes characters outside its vocabulary that way: a reply
ending in one lost it, and DetokenizerV2 could restart its segment inside a
run and corrupt the character. LocalTokenizerBridge.decode now releases a
trailing run itself. Token IDs, sampling, model state and cache keys do not
change; only the text decoded from the same tokens does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests only and the changelog, no source change: a reply of byte tokens alone
longer than any walk bound, a control character written as a byte, and the
unknown-token test loads the tokenizer repeatedly because the probe reads
whichever byte token a dictionary lists first. The changelog now states the
stop-string exception, the streamed logprobs entries, logprobs bytes and
/detokenize.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bumps libs/mlx-swift-lm to ef43498b9 (branch
feat/gemma4-batched-prompt-experts on 7933a0fa). Registered Gemma stages
now compute a prompt frame's expert blocks in one unsorted dispatch per
operation, instead of one subgraph per prompt token (about six launches
per token per layer since the 2026-10-23 token expert policy). Batch-decode
rows share the same call.

Every (token, expert) pair is still an M=1 gather_qmv product, and the
top-8 reduction keeps its one-row col_reduce_small layout. Each token
therefore keeps its bytes, and the exact Gemma arithmetic receipt
(gemma4-bf16-token-expert-reduction-v1) and the cache identities it
separates are unchanged.

Evidence (docs/reports/2026-11-01-gemma-pipeline-prompt-experts.md):
- Gemma4PrefillExpertTests on CPU: bytes equal at 7-512 tokens and
  decode rows 2/3/8, at 4 and 8 bits.
- M5 Ultra GPU: bytes equal for 1-2048 rows at the production kernel
  classes, and at hidden 2816 / width 704 / 128 experts.
- Synthetic expert layer: 2,048 tokens 349.9 -> 36.8 ms.
- Gemma4BatchDecodeTests, Gemma4BatchArithmeticAgreementTests,
  GemmaPrefillArithmeticTests, GemmaPrefixChunkTests and
  ResidentAdmissionGemma4Tests pass.

Not validated: pair throughput, full-model numerics, other GPU generations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gemma4PlacementFamily now states expertRouting (8 of 128 experts per
layer, from Gemma4StageGeometry) and names the experts.switch_glu banks as
routed experts. Gemma layouts carry routedExperts: 12,846,366,720 bytes
(QAT 4-bit) and 24,265,359,360 bytes (8-bit). ClusterHardwarePrior then
reads 2,424,219,708 weight bytes per QAT 4-bit token instead of every
layer byte. That matches the exact-header audit of 2026-09-20, and the
old figure was about 6x too high.

The three Gemma golden layouts gain the block. The 12 golden plan digests
change only by the layout the plan echoes; cut 15 pipeline and both
recorded pairs' ranks are unchanged. GemmaRoutedExpertChecks builds the
QAT 4-bit layout from the retained real headers and requires it to equal
the golden layout. PlacementChecks: 1422 checks pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coordinator-registered Gemma pipeline pairs served one request at a time:
nothing on the native-member path sets a width, and every pipeline lane
adapter defaulted to one. DistributedInstalledPlan.defaultBatchLanes now
gives a text-only Gemma 4 pipeline whose saved setup prefills serially
gemma4PipelineBatchLanes (4), following GLM tensor parallel's installed
default:
- decode rows keep their one-request arithmetic (Gemma4BatchDecodeScope,
  bound by Gemma4BatchArithmeticAgreement), and each prompt frame runs
  alone on its request's chunk grid;
- each lane is charged its whole request state on every rank and admitted
  against live memory (reserveLane); a lane that does not fit is refused
  alone, retryably;
- paged KV reserves pages per request, so the width allocates nothing at
  load, and the activation floor is unchanged (one prompt frame per step).

Lanes prefill serially, so a setup saved with one_chunk_lookahead_v1 keeps
its schedule and one lane. A planned batch width already requires serial
prefill. Every other adapter, a saved width and the owner's
DARKBLOOM_CLUSTER_BATCH_LANES behave as before.

Tests: DistributedInstalledLanesTests (all adapters and schedules),
DistributedInstalledCancellationTests, ClusterPairSlotOwnerLanesTests and
DistributedAutomaticBatchPlannerTests (34 tests). ClusterInstalledSessionChecks
check a Gemma fixture's default reaching the rank and a lookahead fixture
keeping one lane.

Not validated: multi-lane joining, cancellation and output agreement on
the real pair. Raising the default is an owner decision after those runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bumps libs/mlx-swift-lm to 211512fd (feat/gemma4-batched-prompt-experts).
The shared expert call now groups a frame's assignments by expert, so
consecutive threadgroups read the same weights. It still does not give the
gathers the sorted hint, so every pair stays an M=1 gather_qmv product, and
the rows return to token order before the unchanged reduction. Each token's
bytes and the receipt are unchanged.

Evidence: GPU equality at the production kernel classes and at production
geometry; Gemma4PrefillExpertTests, Gemma4BatchDecodeTests,
Gemma4BatchArithmeticAgreementTests and GemmaPrefillArithmeticTests (CPU,
9 tests); and Gemma4StagePagedSyntheticTests (GPU, lanes join and leave).
On a synthetic production-geometry expert layer (4-bit, 2,048 tokens) the
shared call went 37.2 -> 30.8 ms; the per-token graph took 414.3 ms in the
same run. The report and docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MiMo stage decode now encodes its Metal command buffers as GLM's and
Qwen's tensor-parallel decode do: up to 100 operations a buffer with no
input-size bound (MiMoLayerStageSession.decodeCommandBuffers), on the
thread that encodes the step. That covers plain and compact decode
frames, phase-split and alone-route decode (MiMoLayerStageSession.decode),
lane steps (decodeBatch) and pipeline_mtp_v1 rounds, drafts included
(MiMoMTPGeneration.runProducer/runConsumer). Prefill keeps the rank's
16-operation guard and MLX's per-chip size bound. Each routed layer's
expert launch takes a whole 1 GiB bank, so under those limits a decode
step committed a buffer every few launches.

Only commit points move. MiMoDecodeCommandBufferTests drives two random
stages as the session does (tiny BF16, and quantized like the registered
row: MXFP4 experts, affine 8-bit projections, K/V widths 192/128) on
ordinary caches, request-owned pages and two lanes, with a verify window
rolled back on both stages. Residuals, logits rows and every cache and
page array are byte-equal under the guard and the decode limits.

Memory: MLX keeps up to ten command buffers in flight, so a whole stage
step can now be in flight. MiMoRequestStateBudget charges every
full-attention layer's decode-row scores at once (decodeRows: 1, or the
verify window). The LOAD quote is unchanged; requests with prompts
shorter than that window are charged slightly more.

Planner: MiMoPlacementFamily states its routing (8 of 256 experts, the
mlp.switch_mlp banks and scales). The hardware prior then reads
10,767,036,288 bytes a decode step instead of 166,600,109,952. The prior
prices tensor parallel only, so MiMo plans are unchanged. The golden
layout gains routedExperts. The four golden plan digests change only by
the layout the plan echoes; MiMoRoutedExpertChecks proves that, and that
without the block the plans are the recorded ones byte for byte.

Not validated: the registered weights, the real pair and any speed. On
one Mac a synthetic 8-layer stage stepped about 13% slower under the
decode limits (encode-bound, KB-sized launches). The real pair A/B
decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- libs/mlx-swift-lm -> 3c01ffce. SwitchGLU.callAndWeightedReduceRows is now
  package rather than public: its only caller is Gemma4Experts. Its
  documentation says that Qwen4's tiled expert kernels are outside its
  per-row guarantee. Gemma4Experts reaches it through one branch. The tests
  add a single row and tied routes, on the CPU and in the opt-in GPU check.
- Docs:
  - The Gemma lanes' memory facts move to hardware-support's "Gemma paged
    cluster lanes" section, from the prompt-projection section.
  - inference.md and the two-Mac how-to link the width instead of restating
    it.
  - The automatic-batching paragraph says that a local serial Gemma pair
    starts at its default width and can still be widened.
  - The gather_qmv sentence says what the selection reads: never the row
    count.
  - test.md and the report record the tied-route checks.
- DistributedInstalledPlan.gemma4PipelineBatchLanes: comment wording only.

Validation (nice 19, jobs 6):
- darkbloom-cluster debug harness with the SDK test file linked in: 29
  tests in 7 suites pass (the Gemma expert, batch-decode, arithmetic, prefix,
  admission and paged synthetic suites).
- GEMMA4_EXPERT_ROWS_GPU=production on the M5 Ultra: bytes equal.
- Provider: 34 lane, cancellation, slot-owner and batch-planner tests pass.
- PlacementChecks: 1,422 pass. ClusterInstalledSessionChecks: pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The quantized MiMoDecodeCommandBufferTests model was said to pass MLX's
per-buffer size bound, but MLX counts that bound in Mi elements of
distinct inputs (40-50 a buffer by chip) and each of the model's expert
banks holds 2 Mi, so under the rank's guard its decode committed by
operation count only. The registered row's banks hold 256 Mi elements
each, and under the guard every expert launch commits a buffer.

The quantized cases (one request and two lanes) now take their guarded
run under bankGuard: 16 operations and a size bound of 1, so each bank
commits a buffer, as each registered bank does. The tiny model keeps
the rank's guard. Residuals, logits rows and every cache and page array
stay byte-equal against MiMoLayerStageSession.decodeCommandBuffers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The decode-row workspace term prices float32 score rows of every
full-attention layer at once. The docs said the workspace holds those
scores. Only a verify window of three or four rows builds them (MLX's
unfused path, in bfloat16). One or two rows take the fused vector
kernel, whose float32 partials on Max and Ultra GPUs
(sdpa_vector_2pass) can exceed a score row and are not priced
separately. Say so, and that peak memory on the registered model is
not measured yet.

The changelog now names which requests pay more: those whose prompt
frames are shorter than a stage's full-attention layers times the
decode rows, 32 tokens at most.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pins the SDK commit that declares decode command-buffer limits on Gemma4TextModel, with docs and a changelog fragment. No provider source changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…very remaining family

The pipeline stages of the Qwen catalog (dense, routed-expert and Prism
rows), Nemotron, Gemma 4, GPT-OSS and GLM now encode decode work as GLM's
and Qwen's tensor-parallel decode do: up to 100 operations a buffer with no
input-size bound (QwenLayerStageSession.decodeCommandBuffers), on the thread
that encodes it. That covers plain and compact decode frames, phase-split
and alone-route decode (QwenLayerStageSession.decode), lane steps
(decodeBatch), pipeline_mtp_v1 rounds on both ranks, drafts included
(QwenPipelineMTPGeneration.runProducer/runConsumer), phase_split_mtp_v1
rounds on the decoding rank (QwenMTPDecoder.step), GPT-OSS decode frames and
lane steps (GPTOSSLayerStageSession.decode/decodeBatch) and GLM decode
frames (GLM5NextStageSession.forward). Prefill keeps the rank's 16-operation
guard and MLX's per-chip size bound, under which every routed-expert launch
of the 35B A3B rows, Nemotron, Gemma 4 and GLM commits a buffer. MiMo's
pipeline is left to its own change.

Only commit points move. PipelineDecodeCommandBufferTests drives random
stages of each family as its session does (dense and routed Qwen 3.5 on a
paged host with a captured verify window and two lanes, two Nemotron
stages, a Gemma 4 decoder with lanes, two GPT-OSS stages with lanes, the
verified GLM fixture's stages). Every row, window and state array is
byte-equal under the rank's guard (or bankGuard, whose 2 Mi-element banks
each commit a buffer), under a buffer every second dispatch, and under the
decode limits.

Memory: MLX keeps up to ten buffers in flight, so a whole stage step's
temporaries can be alive at once. Each family's request charge now prices
every attending layer's decode rows together, never less than one prompt
frame's: QwenResidentPrefillTransient (decodeRows: one a layer, or depth + 1
in speculative modes, over every layer on a phase split's decoding rank;
LayerStageDecodeShape), Gemma4PrefillTransient and GPTOSSRequestStateBudget.
GLM already charges every request its profile's whole envelope. LOAD quotes
are computed at the 512-token chunk and are unchanged; only requests whose
prompt frames are shorter than their decode rows (at most 80) pay more. The
fused vector-attention partials are not priced separately.

Not validated: registered weights, the real pair, speed and peak memory.
Each family keeps its limits only if a pair A/B shows at least a 3% decode
gain with identical tokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LayerStageDecodeShape(mode:rank:) gave rank 0 of a phase split one decode
row a layer (plain) or depth + 1 (phase_split_mtp_v1) over its own stage.
That rank exports its prompt state, retires and publishes what rank 1
relays: it runs no decode forward, so the decode limits never apply there.
A short prompt on it was charged rows it never runs (Qwen3.8 27B at depth
4, cut 32: 40 score rows, about 120 MiB at a 32,769-token context, instead
of one), contrary to the change's own rule that only requests whose prompt
frames are shorter than their decode rows pay more.

The producer rank now gets 0 rows, which leaves its charge as it was
before the decode-row term. The decoding rank, pipeline_mtp_v1 on both
ranks, lanes and the LOAD quotes (chunk 512) are unchanged.
ContextAdmissionTests pins the shape for both phase-split modes, and the
Nemotron admission test checks that a one-token prompt on that rank pays
only its prompt frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aves out

inference.md said decode rows and verify windows take MLX's vector
attention (sdpa_vector_2pass), whose partials can exceed a score row. On
the cluster that holds only for GPT-OSS. The Qwen, Nemotron and Gemma 4
stages keep their keys and values in the paged stage KV, where decode
steps, lane steps and verify windows (one decode row a window column,
CBv2OwnedRequestState.buildingWindow) attend through the paged decode
kernel. Its float32 partials are heads x ceil(keys / 256) x (width + 2) x
4 bytes a row: about one score row at width 256, two on Gemma's full
layers and half on Nemotron's. The page now says so and bounds the excess
over the priced rows at tens of MiB a request, times the lanes.

Also: the phase split's producer rank prices no decode rows (previous
commit); GLM's envelope frame is its own chunk, not 512 rows; the
changelog names the Qwen3.8 row (it said Qwen 3.5/3.6) and the phase
split's decode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…when no tools are declared

The stop scope excluded tool-call spans on every request. Without declared tools the parser returns a literal <tool_call> or <|tool_call> as content, so a stop after it never matched: an independent check on Qwen3.5-9B got all three sentences back for stop "." where master returned one. The spans are now excluded only when the request has a tool stream handler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tools

tool_choice none and generic vision media with tools have no handler, and MiMo always has one. Comment and docs only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sion

The production GLM-5.3-Flash pair (2026-11-01 03:37Z) stopped serving for
13 hours: after a peer loss the leader's session ended while its stop was
still waiting, and every later committed start was refused with "a committed
start is already served". These tests drive the leader's real serve/stop
state machine with a scripted pair:

- a session that ends while its serve cannot finish must release the start
  for the next one, and the stale serve must stand down;
- the start is released while the slot's drain still runs;
- a start whose session already stopped is never served.

They fail on origin/master and pass with the fix that follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The leader's one-start token (clusterPairServingEpoch) was cleared only once
the session's stop had retired the pair slot, and never while a serve was
still forming. After a peer loss or fence, the slot's drain or the serve
could outlast the session's bounded wait (stopServing gives up at the grant's
cleanup deadline); the session sent its release receipt anyway, and the
token outlived it. Nothing else cleared it, so every later committed start
was refused until a restart.

The session's stop now releases the token at once and records the epoch as
ended. Every stop call still waits for the slot to retire before the receipt.
A serve re-checks that it still holds its start after each suspension and
stands down (shuts its owner down, retires what it published) without
touching a newer start. The stopped and forming flags are gone: the token is
the ownership. The slot-level guard against two published slots is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to HEAD

# Conflicts:
#	docs/architecture/inference.md
#	provider-swift/Sources/ProviderCore/Inference/Distributed/Installed/DistributedInstalledPlan.swift
… into HEAD

# Conflicts:
#	docs/architecture/inference.md
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Error Error Nov 3, 2026 12:19pm UTC
d-inference-console-ui-dev Error Error Nov 3, 2026 12:19pm UTC
d-inference-landing Ready Ready Preview Nov 3, 2026 12:19pm UTC
darkbloom-status Ready Ready Preview Nov 3, 2026 12:19pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 3, 2026 12:19pm UTC

Request Review

#1724 measured the 8-lane LOAD figures before #1725 added the shared
367,001,600-byte merged-step term to every Qwen TP batch quote. With both
merged, ClusterPlacementTensorWidthRegisteredTests prints 40,911,618,048 /
60,734,767,104 bytes reserved per rank and 54,441,306,624 /
77,998,565,888 bytes needed (composition CI run 41631482989). The width
table is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidtai added a commit that referenced this pull request Nov 3, 2026
Conflicts with #1704 (merged): the defaultBatchLanes doc comment in
DistributedInstalledPlan.swift keeps both #1704's Gemma 4 exception and
this PR's saved Qwen TP width sentence; inference.md "Last updated" takes
the later date. Same resolution as composition check #1738.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidtai added a commit that referenced this pull request Nov 3, 2026
Conflicts with #1724 (merged) in docs/architecture/inference.md only: the
date line takes 2026-11-03, and both new sections ("Qwen tensor-parallel
saved width", then "Qwen tensor-parallel prompt wavefront") are kept. Same
resolution as composition check #1738.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidtai

davidtai commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

Composition check done: final dev 031cb87 has the same tree as this branch (git diff empty). Closing as planned.

@davidtai davidtai closed this Nov 3, 2026
@davidtai
davidtai deleted the ci/0.10.7-deferred-composition branch November 3, 2026 12:23

This branch had an error being deployed

2 failed and 3 active deployments
Preview – d-inference-landing — 39d8f0cc Deployed Nov 3, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 39d8f0cc Deployed Nov 3, 2026 by vercel[bot]
Preview – darkbloom-status — 39d8f0cc Deployed Nov 3, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 39d8f0cc Deployed Nov 3, 2026 by vercel[bot]
Preview – d-inference — 39d8f0cc Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants